﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.ComponentModel.DataAnnotations;

namespace MyBlog2.Models
{
    public class ArticleClassify
    {
        public ArticleClassify()
        {
            this.Articles = new HashSet<Article>();
        }

        public int Id { get; set; }

        [Required(ErrorMessage = "{0}不能为空")]
        [Display(Name = "分类名称")]
        public string Name { get; set; }

        [Required(ErrorMessage = "{0}不能为空")]
        [Display(Name = "分类排序")]
        [Range(1,1000,ErrorMessage = "1-999")]
        public int Sort { get; set; }

        public virtual ICollection<Article> Articles { get; set; }      //关联文章
    }
}
